/*
 * @Author: wuyuxin
 * @Date: 2021-12-12 23:34:18
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-01-08 21:08:30
 * @Description: 
 */

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import singleSpaVue from 'single-spa-vue'

Vue.config.productionTip = false


const appOptions = {
  el: '#vue',
  router,
  store,
  render: h => h(App)
}

// 父应用引用
if (window.singleSpaNavigate) {
 __webpack_public_path__ = 'http://localhost:10000/' 
}
if (!window.singleSpaNavigate) {
  delete appOptions.el;
  new Vue(appOptions).$mount(`#app`);
}
const vueLifeCycle = singleSpaVue({
  Vue,
  appOptions
})

// 协议接入
// export const { bootstrap, mount, unmount } = vueLifeCycle
export const bootstrap = vueLifeCycle.bootstrap
export const mount = vueLifeCycle.mount
export const unmount = vueLifeCycle.unmount

// 我们需要父应用子应用

// bootstrap mount unmount